Skip to content

Fix Paper output schema compatibility with OpenAI Agents strict schema validation#81

Open
Auzdog wants to merge 1 commit into
LLMQuant:masterfrom
Auzdog:fix/paper-output-schema-openai-agents
Open

Fix Paper output schema compatibility with OpenAI Agents strict schema validation#81
Auzdog wants to merge 1 commit into
LLMQuant:masterfrom
Auzdog:fix/paper-output-schema-openai-agents

Conversation

@Auzdog

@Auzdog Auzdog commented Jun 15, 2026

Copy link
Copy Markdown

Problem

OpenAI Agents strict schema validation rejects Paper as an Agent output type because TreeKnowledge.nodes is a dict-valued field and the generated JSON schema includes additionalProperties.

Observed error

"Strict JSON schema is enabled, but the output type is not valid..."

"additionalProperties should not be set for object types."

Environment

  • Python 3.12.13
  • openai-agents 0.17.5
  • QuantMind commit before patch: 8e21888

Fix

Wrap the default Paper output type with AgentOutputSchema(Paper, strict_json_schema=False) when output_type is the base Paper class. Custom output types continue to pass through unchanged.

Validation

  • paper_flow runs successfully on RawText input (downstream wrapper smoke on OpenAI Agents 0.17.5)
  • Downstream wrapper validates emitted output through a vendor schema and adapter mapping
  • Existing validation/tests:
    • bash scripts/verify.sh: ruff format, ruff check, basedpyright, lint-imports — PASS
    • pytest --cov: 232 passed, 1 failed (test_local_file_branch — Windows /tmp vs \tmp path assertion; unrelated to this patch)
    • Coverage 89.49% (75% floor met)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant